{% extends 'layout.html' %}
{% block content %}

<div class="container">
  <div style="margin-bottom: 10px" >
    <!--    上下间距-->
    <!--    target="_blank" 新页面打开-->
    <a class="btn btn-primary" href="admin/add" >
      <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
      新增管理员账号
    </a>


<!--    搜索-->
    <div style="float:right;width: 250px">
      <!--            这里的宽度好像会导致换行-->
      <div class="form-inline">
        <form method="get">
          <input type="text" class="form-control" placeholder="Search" name="q" value="{{val}}">
          <button type="submit" class="btn btn-default">
            <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
          </button>
        </form>
      </div>
    </div>

  </div>




  <div class="panel  panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">编辑管理员信息</h3>
    </div>

    <!-- Table -->
    <table class="table table-bordered "   >
      <thead >
      <tr >
        <th>ID</th>
        <th>姓名</th>
        <th>密码</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody >
      {% for item in queryset%}
      <tr>
        <td>{{ item.id }}</td>
        <td>{{ item.name}}</td>
        <td>{{ item.password}}</td>
        <td>
          <!--                    get到id的方法一：-->
          <a class="btn btn-success btn-xs" href="admin_edit/{{item.id}}">编辑</a>
          <!--                    get到id的方法二：-->
          <a class="btn btn-danger btn-xs" href="admin_delete/{{item.id}}">删除</a>
        </td>
      </tr>
      {% endfor %}
      </tbody>
    </table>

  </div>
</div>


{% endblock %}